#!/usr/bin/env python3

import sys
sys.path.append('../../../tools')
from gmcore_plot import *

parser = argparse.ArgumentParser(description='Plot test results')
parser.add_argument('-t', '--time-step', type=int, default=6, help='Time step to plot')
parser.add_argument('-o', '--output', help='Output figure')
args = parser.parse_args()

f = xr.open_dataset('swm_jz.720x360.h0.nc')

fig = plt.figure(figsize=(10, 5))
proj = ccrs.PlateCarree()
ax = plt.axes(projection=proj)
plot_contour_map(ax, f.pv[args.time_step,0,:,:], cmap='jet', left_string=((f.time[args.time_step] - f.time[0]).values).astype('timedelta64[D]'))

if args.output:
	plt.savefig(args.output, dpi=300)
else:
	plt.show()
